<?php
switch($action){
	/************************************** set BEGIN ************************************************/
	case "set":
echo <<<EOT
	<div id="smalltab_container"></div>
	<div class="smalltab_line"></div>
	<div id="t1">
		<form id="forumform" onsubmit="return false;">
		<div class="div_clear" style="height:10px;"></div>
		<table class="table_1">
			<tr class="tr_5"><td class="td_5_1" style="font-weight:bold;color:#333333;">[顺序]版块名称</td><td class="td_5_2" style="font-weight:bold;color:#333333;">版主</td><td class="td_5_3" style="font-weight:bold;color:#333333;">操作</td><td>&nbsp;</td></tr>
EOT;

				$tabindex=1000;
				$rows1=$db->row_select("forums","pid=0",0,"*","ordernum,id");
				for($i=0;$i<count($rows1);$i++){
					$row1=$rows1[$i];
					$tabindex++;
					$row1['admins'] = getAdmins($row1['admins']);
					echo("<tr class=\"tr_5\"><td class=\"td_5_1\"><span class=\"forum_click1\"></span><input type=\"text\" size=\"2\" value=\"{$row1[ordernum]}\" name=\"ordernum[{$row1['id']}]\" tabIndex=\"{$tabindex}\" class=\"text_css\" /> <input type=\"text\" size=\"15\" value=\"{$row1[forumname]}\" name=\"forumname[{$row1['id']}]\" tabIndex=\"1{$tabindex}\" style=\"font-weight:bold;\" class=\"text_css\" /> <span style='color:#999999;'>FID:{$row1['id']}</span> <a href=\"admin.php?inc=forum&action=add&pid={$row1['id']}\"><img src=\"images/ico_add.gif\" border=\"0\" /> 添加子版块</a></td><td class=\"td_5_2\"><a href=\"admin.php?inc=forum&action=admins&id={$row1['id']}\">{$row1['admins']}</a></td><td class=\"td_5_3\"><a href=\"admin.php?inc=forum&action=edit&id={$row1['id']}\">编辑</a> &nbsp; <a href=\"javascript:ajax_delforum_yn({$row1['id']})\">删除</a></td><td>&nbsp;</td></tr>");
					$rows2=$db->row_select("forums","pid={$row1['id']}",0,"*","ordernum,id");
					for($j=0;$j<count($rows2);$j++){
						$row2=$rows2[$j];
						$tabindex++;
						$row2['admins'] = getAdmins($row2['admins']);
						echo("<tr class=\"tr_5\"><td class=\"td_5_1\"><span class=\"forum_1\"></span><input type=\"text\" size=\"2\" value=\"{$row2[ordernum]}\" name=\"ordernum[{$row2['id']}]\" tabIndex=\"{$tabindex}\" class=\"text_css\" /> <input type=\"text\" size=\"15\" value=\"{$row2[forumname]}\" name=\"forumname[{$row2['id']}]\" tabIndex=\"1{$tabindex}\" class=\"text_css\" /> <span style='color:#999999;'>FID:{$row2['id']}</span> <a href=\"admin.php?inc=forum&action=add&pid={$row2['id']}\"><img src=\"images/ico_add.gif\" border=\"0\" /> 添加子版块</a></td><td class=\"td_5_2\"><a href=\"admin.php?inc=forum&action=admins&id={$row2['id']}\">{$row2['admins']}</a></td><td class=\"td_5_3\"><a href=\"admin.php?inc=forum&action=edit&id={$row2['id']}\">编辑</a> &nbsp; <a href=\"javascript:ajax_delforum_yn({$row2['id']})\">删除</a>&nbsp; <a href=\"admin.php?inc=forum&action=editpopedom&id={$row2['id']}\">权限</a> &nbsp; </td><td>&nbsp;</td></tr>");
						$rows3=$db->row_select("forums","pid={$row2['id']}",0,"*","ordernum,id");
						for($k=0;$k<count($rows3);$k++){
							$row3=$rows3[$k];
							$tabindex++;
							$row3['admins'] = getAdmins($row3['admins']);
							echo("<tr class=\"tr_5\"><td class=\"td_5_1\"><span class=\"forum_0\"></span><span class=\"forum_1\"></span><input type=\"text\" size=\"2\" value=\"{$row3[ordernum]}\" name=\"ordernum[{$row3['id']}]\" tabIndex=\"{$tabindex}\" class=\"text_css\" /> <input type=\"text\" size=\"15\" value=\"{$row3[forumname]}\" name=\"forumname[{$row3['id']}]\" tabIndex=\"1{$tabindex}\" class=\"text_css\" /> <span style='color:#999999;'>FID:{$row3['id']}</span></td><td class=\"td_5_2\"><a href=\"admin.php?inc=forum&action=admins&id={$row3['id']}\">{$row3['admins']}</a></td><td class=\"td_5_3\"><a href=\"admin.php?inc=forum&action=edit&id={$row3['id']}\">编辑</a> &nbsp; <a href=\"javascript:ajax_delforum_yn({$row3['id']})\">删除</a>&nbsp; <a href=\"admin.php?inc=forum&action=editpopedom&id={$row3['id']}\">权限</a> &nbsp; </td><td>&nbsp;</td></tr>");
						}
					}
				}
				echo("<tr class=\"tr_5\"><td><a class=\"td_5_1a\" href=\"admin.php?inc=forum&action=add\"><img src=\"images/ico_add.gif\" border=\"0\" /> 添加分区</a></td><td class=\"td_5_2\"></td><td class=\"td_5_3\"></td><td>&nbsp;</td></tr>");
echo <<<EOT
			<tr><td class="td_3"><input class="button_css" type="button" value="  提  交  " onclick="ajax_saveforum()" /></td></tr>
		</table>
		</form>
	</div>
	<div id="t2"></div>
	<div id="t3"></div>
	<div class="div_clear" style="height:30px;"></div>
	<script>
	var smallNowTab;
	var pt = new Tabs();
	pt.classpre="smalltab_";
	pt.container = "smalltab_container";
	pt.createTab("t1","版块设置","",true,"n");
	pt.init = function(){
		smallNowTab = pt.nowTab;
	};
	pt.onclick = function(){
		smallNowTab = pt.nowTab;
	};		
	pt.initTab();
	pt.clickNowTab();
	
	var isoff="{$row['isoff']}";
	setRadioCheck("isoff",isoff);
	
	function ajax_saveforum(){
		popwin.loading();
		ajaxPost("forumform","forum_ajax.php?action=saveforum",ajax_saveforum_callback);
	}
	function ajax_saveforum_callback(data){
		var btns=[{value:" 确 定 ",onclick:"popwin.close();mainifm.location.reload();",focus:true}];
		popwin.loaded();
		if(data=="y"){
			popwin.showDialog(1,"修改成功","版块设置修改成功",btns,280,130);
		}else{
			popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,280,130);
		}
	}
	
	function ajax_delforum_yn(fid){
		var btns=[
			{value:" 确 认 ",onclick:"mainifm.ajax_delforum("+fid+")",focus:true},
			{value:" 取 消 ",onclick:"popwin.close()"}
		];
		popwin.showDialog(3,"确认","该操作会一起删除该版块的帖子以及附件，并不可恢复。<br />是否确认删除？",btns,320,130);
	}	
		
	function ajax_delforum(fid){
		popwin.loading();
		ajaxGet("forum_ajax.php?action=delforum&fid="+fid, ajax_delforum_callback);
	}
	function ajax_delforum_callback(data){
		var btns=[{value:" 确 定 ",onclick:"popwin.close();mainifm.location.reload();",focus:true}];
		popwin.loaded();
		if(data=="y"){
			popwin.showDialog(1,"删除成功","版块删除成功",btns,320,130);
		}else{
			popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,320,130);
		}
	}
	
	</script>
EOT;

	break;
	/************************************** set END ************************************************/

	/************************************** admins BEGIN ************************************************/
	case "admins":
	$id=numFilter($_GET['id']);
	require_once getCacheFilePath('forums.php');
	$dwidth=array(0,50,80,200,180,250,150);

echo <<<EOT
<script>
var maxIndex=0;
function addAdmins(adminid, ordernum, adminname, isparent){
	var namepre='admins';
	var checkboxstr='';
	var parstr='';
	var orderstr='';
	var namestr='';
	if(adminid==''){
		namepre='newadmins';
	}
	
	if(isparent){
		namestr=adminname;
		checkboxstr='<input type="checkbox" disabled="true" class="checkbox_css" />';
		orderstr='&nbsp;';
		parstr='<span style="color:#666666;">是</span>';
	}else{
		if(adminname!=""){
			namestr=adminname+"<input type='hidden' value='"+adminname+"' size='20' name='admins["+maxIndex+"][name]' />";
		}else{
			namestr="<input type='text' value='"+adminname+"' size='20' name='admins["+maxIndex+"][name]' class=\"text_css\" />";
		}
		checkboxstr='<input type="checkbox" value="1" name="admins['+maxIndex+'][delid]" class="checkbox_css" />';
		orderstr='<input type="text" size="6" value="'+ordernum+'" name="admins['+maxIndex+'][ordernum]" class=\"text_css\" />';
		parstr='否';
	}
	var s="<table class=\"table_1\" width=\"100%\"><tr><td class=\"td_6\"><div class=\"rowdiv_0\" style=\"width:{$dwidth[1]}px;\">"+checkboxstr+"</div><div class=\"rowdiv_0\" style=\"width:{$dwidth[2]}px;\">"+orderstr+"</div><div class=\"rowdiv_0\" style=\"width:{$dwidth[3]}px;\">"+namestr+"</div><div class=\"rowdiv_0\" style=\"width:{$dwidth[4]}px;\">"+parstr+"</div></td></tr></table>";
	var ele=document.createElement('div');
	ele.id="group_div_"+maxIndex;
	ele.innerHTML=s;
	E("adminsdiv").appendChild(ele);
	maxIndex++;
}
</script>

	<div id="smalltab_container"></div>
	<div class="smalltab_line"></div>
	<div class="div_clear" style="height:10px;"></div>
	<div id="t1">
		<form id="adminsform" onsubmit="return false;">
		<div class="tips_1"><b>提示</b><br />
	* 请填写版主的名称。<br /></div>
		<div class="div_clear" style="height:10px;"></div>
		<table class="table_1" width="100%">
			<tr style="font-weight:bold;color:#333333;"><td class="td_6"><div class="rowdiv_0" style="width:{$dwidth[1]}px;"><span class="warning">删除</span></div><div class="rowdiv_0" style="width:{$dwidth[2]}px;">显示顺序</div><div class="rowdiv_0" style="width:{$dwidth[3]}px;">版主用户名</div><div class="rowdiv_0" style="width:{$dwidth[4]}px;">是否上级版块</div></td></tr>
		</table>
		<div id="adminsdiv">
EOT;
			$padmins=$cache_forums["{$id}"]['padmins'];
			$arr=explode("|",$padmins);
			for($i=0;$i<count($arr);$i++){
				$admin=$arr[$i];
				if(!empty($admin)){
					echo("<script>addAdmins(\"\",\"{$i}\",\"{$admin}\",true);</script>");
				}		
			}
			$admins=$cache_forums["{$id}"]['admins'];
			$arr=explode("|",$admins);
			for($i=0;$i<count($arr);$i++){
				$admin=$arr[$i];
				if(!empty($admin)){
					echo("<script>addAdmins(\"\",\"{$i}\",\"{$admin}\",false);</script>");	
				}
			}
			
echo <<<EOT
		</div>
			<table class="table_1" width="100%">
			<tr><td class="td_6"><a class="td_5_1a" href="javascript:addAdmins('','','',false)"><img src="images/ico_add.gif" border="0" /> 添加版主</a></td></tr>
			<tr><td class="td_3"><input class="button_css" type="button" value="  提  交  " onclick="ajax_admins()" /></td></tr>
		</table>
		</form>
	</div>
	<div id="t2"></div>
	<div id="t3"></div>
	<div class="div_clear" style="height:30px;"></div>
<script>
var hasErr=false;
var smallNowTab;
var pt = new Tabs();
pt.classpre="smalltab_";
pt.container = "smalltab_container";
pt.createTab("t1","版主设置","",true,"n");
pt.init = function(){
	smallNowTab = pt.nowTab;
};
pt.onclick = function(){
	smallNowTab = pt.nowTab;
};		
pt.initTab();
pt.clickNowTab();

function ajax_admins(){
	popwin.loading();
	ajaxPost("adminsform","forum_ajax.php?action=saveadmins&id={$id}",ajax_admins_callback);
}
function ajax_admins_callback(data){
	var btns=[{value:" 确 定 ",onclick:"popwin.close();mainifm.location.reload();",focus:true}];
	popwin.loaded();
	if(data=="y"){
		popwin.showDialog(1,"编辑成功","版主设置成功",btns,280,130);
	}else{
		popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,280,130);
	}
}

</script>

EOT;
	break;
	/************************************** admins END ************************************************/


	/************************************** add edit BEGIN ************************************************/
	case "add":
	case "edit":
	case "editpopedom":
	$id=numFilter($_GET['id']);
	$pid=numFilter($_GET['pid']);
	if($action=="add"){
		$row=null;
	}else{
		$row=$db->row_select_one("forums","id={$id}","*");
		$pid=$row['pid'];
	}
	
	$options="";
	$rows1=$db->row_select("forums","pid=0",0,"*","ordernum,id");
	for($i=0;$i<count($rows1);$i++){
		$row1=$rows1[$i];
		$options.="<option value=\"{$row1['id']}\">&nbsp;&gt;&gt;&nbsp;{$row1[forumname]}</option>";
		$rows2=$db->row_select("forums","pid={$row1['id']}",0,"*","ordernum,id");
		for($j=0;$j<count($rows2);$j++){
			$row2=$rows2[$j];
			$options.="<option value=\"{$row2['id']}\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|--&nbsp;&nbsp;{$row2[forumname]}</option>";
		}
	}

echo <<<EOT
	<div id="smalltab_container"></div>
	<div class="smalltab_line"></div>
	<div class="div_clear" style="height:10px;"></div>
	<div id="t1">
		<form id="forumdetailsform" onsubmit="return false;">
		<table class="table_1">
			<tr><td class="td_0">分类/版块名称:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="hidden" name="doaction" id="doaction" value="{$action}" /><input type="hidden" name="id" id="id" value="{$id}" /><input type="text" size="30" value="{$row['forumname']}" name="forumname" id="forumname"  class="text_css" /></td><td class="td_2">设置分类/版块名称</td></tr>

EOT;

	if($pid>0){
echo <<<EOT
			<tr><td class="td_0">版块图标:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="text" size="30" value="{$row['picurl']}" name="picurl" id="picurl" class="text_css" /></td><td class="td_2">设置版块的代表性图标</td></tr>
			<tr><td class="td_0">版块介绍:</td><td class=""></td></tr>
			<tr><td class="td_1"><textarea style="height:70px;width:280px;" name="forumcontent" id="forumcontent">{$row['forumcontent']}</textarea></td><td class="td_2">设置版块的简介</td></tr>
			<tr><td class="td_0">版块规则:</td><td class=""></td></tr>
			<tr><td class="td_1"><textarea style="height:70px;width:280px;" name="rules" id="rules">{$row['rules']}</textarea></td><td class="td_2">显示在版块帖子顶部的规则说明</td></tr>
			<tr><td class="td_0">上级版块:</td><td class=""></td></tr>
			<tr><td class="td_1"><select name="pid" id="pid">{$options}</select></td><td class="td_2">本版块的上级版块或分类</td></tr>
			<tr><td class="td_0">帖子审核:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="radio" value="0" name="isneedverify" class="radio_css" /> 不需要审核  &nbsp;<input type="radio" value="1" name="isneedverify" class="radio_css" /> 审核主题  &nbsp;<input type="radio" value="2" name="isneedverify" class="radio_css" /> 审核主题和回复</td><td class="td_2">设置该版块的帖子是否经过审核才显示出来</td></tr>

EOT;
	}
echo <<<EOT
			<tr><td class="td_0">是否隐藏:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="radio" value="1" name="ishidden" class="radio_css" /> 是 &nbsp; &nbsp;<input type="radio" value="0" name="ishidden" class="radio_css" /> 否</td><td class="td_2">设置该版块是否隐藏。用户仍可通过URL访问到此版块</td></tr>
EOT;

echo <<<EOT
			<tr><td class="td_0">显示方式:</td><td class=""></td></tr>
			<tr><td class="td_1"><select id="showtype" name="showtype"><option value="0">普通方式</option><option value="1">横排方式</option></select></td><td class="td_2">设置该分区下级子版块的显示方式</td></tr>
EOT;

echo <<<EOT
			<tr><td class="td_0">搜索关键字优化:</td><td class=""></td></tr>
			<tr><td class="td_1"><textarea style="height:60px;width:280px;" name="metakeywords" id="metakeywords">{$row['metakeywords']}</textarea></td><td class="td_2">Meta Keywords的优化，有助于搜索引擎的收录。</td></tr>

			<tr><td class="td_3"><input class="button_css" type="button" value="  提  交  " onclick="ajax_saveforumdetails()" /></td><td class=""></td></tr>
		</table>
		</form>
	</div>
	<div id="t2">
		<form id="forumpopedomform" onsubmit="return false;">
		<table class="table_1">
			<tr><td class="td_0">访问密码:</td><td class=""></td></tr>
			<tr><td class="td_1"><input type="hidden" name="id" id="id" value="{$id}" /><input type="text" value="{$row['forumpass']}" id="forumpass" name="forumpass" class="text_css" /></td><td class="td_2">设置访问版块的密码，不设置密码请留空。</td></tr>
			<tr><td class="td_0">允许访问用户:</td><td class=""></td></tr>
			<tr><td class="td_1"><textarea style="height:150px;width:200px;" name="forumusers" id="forumusers">{$row['forumusers']}</textarea></td><td class="td_2">设置可以访问该版块的用户，每行填写一个用户。</td></tr>
			<tr><td class="td_0">允许访问用户组:</td><td class=""></td></tr>
			<tr><td class="td_1"><select size="10" multiple="multiple" style='width:200px;padding-left:5px;' name="forumgroups" id="forumgroups"><option value="0">所有分组</option><optgroup label="普通组">{$cache_groups1option}</optgroup><optgroup label="系统组">{$cache_groups2option}</optgroup></select></td><td class="td_2">设置允许访问版块的用户组，可以按住 CTRL 多选</td></tr>
			<tr><td class="td_3"><input class="button_css" type="button" value="  提  交  " onclick="ajax_saveforumpopedom()" /></td><td class=""></td></tr>
		</table>
		</form>
	</div>
	<div id="t3"></div>
	<div class="div_clear" style="height:30px;"></div>
	<script>
	var smallNowTab;
	var pt = new Tabs();
	var doaction="{$action}";
	pt.classpre="smalltab_";
	pt.container = "smalltab_container";
	if(doaction=="add"){
		pt.createTab("t1","添加版块","",true,"n");
		setDisplay("t2",false);
	}else{
		pt.createTab("t1","编辑版块","",true,"n");
		pt.createTab("t2","访问权限","",false,"n");
	}
	pt.init = function(){
		smallNowTab = pt.nowTab;
	};
	pt.onclick = function(){
		smallNowTab = pt.nowTab;
	};		
	pt.initTab();
	pt.clickNowTab();
	

	var isneedverify="{$row['isneedverify']}";
	var ishidden="{$row['ishidden']}";
	var showtype="{$row['showtype']}";
	var pid="{$pid}";
	var id="{$id}";
	if(id!=""){
		var forumgroups="{$row['forumgroups']}";
		var ts=forumgroups.split(",");
		for(var i=0;i<ts.length;i++){
			setSelect("forumgroups",ts[i]);
		}
	}
	
	
	setRadioCheck("isneedverify",isneedverify);
	setRadioCheck("ishidden",ishidden);
	setSelect("showtype",showtype);
	setSelect("pid",pid);
	
	function ajax_saveforumdetails(){
		popwin.loading();
		ajaxPost("forumdetailsform","forum_ajax.php?action=saveforumdetails",ajax_saveforumdetails_callback);
	}
	function ajax_saveforumdetails_callback(data){
		var tips=(doaction=="add"?"版块添加成功":"版块设置修改成功");
		var btns=[{value:" 确 定 ",onclick:"popwin.close();mainifm.location.reload();",focus:true}];
		popwin.loaded();
		if(data=="y"){
			popwin.showDialog(1,"修改成功",tips,btns,280,130);
		}else{
			popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,280,130);
		}
	}
	
	function ajax_saveforumpopedom(){
		popwin.loading();
		ajaxPost("forumpopedomform","forum_ajax.php?action=saveforumpopedom",ajax_saveforumpopedom_callback);
	}
	function ajax_saveforumpopedom_callback(data){
		var btns=[{value:" 确 定 ",onclick:"popwin.close();",focus:true}];
		popwin.loaded();
		if(data=="y"){
			popwin.showDialog(1,"修改成功","版块访问权限修改成功",btns,280,130);
		}else{
			popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,280,130);
		}
	}
	
	function InitPage(){
		if(doaction=="editpopedom"){
			pt.click('t2');
		}
	}
	
	window.onload = InitPage;
	
	</script>
EOT;

	
	break;
	/************************************** add edit BEGIN ************************************************/
	
	
	
	/************************************** merge BEGIN ************************************************/
	case "merge":
echo <<<EOT
	<div id="smalltab_container"></div>
	<div class="smalltab_line"></div>
	<div class="div_clear" style="height:10px;"></div>
	<div id="t1">
		<form id="forumdetailsform" onsubmit="return false;">
		<div class="tips_1"><b>提示</b><br />
	* 源版块的帖子全部转入目标版块，同时删除源版块。<br /></div>
		<div class="div_clear" style="height:10px;"></div>
		<table class="table_1">
			<tr><td class="td_0">源版块</td><td class=""></td></tr>
			<tr><td class="td_1"><select name="fromfid" id="fromfid"><option value="0">请选择</option>{$cache_forumsoption2}</select></td><td class="td_2">源版块的帖子全部转入目标版块，同时删除源版块</td></tr>
			<tr><td class="td_0">目标版块</td><td class=""></td></tr>
			<tr><td class="td_1"><select name="tofid" id="tofid"><option value="0">请选择</option>{$cache_forumsoption2}</select></td><td class="td_2"></td></tr>
			<tr><td class="td_3"><input class="button_css" type="button" value="  提  交  " onclick="ajax_mergeforum_yn()" /></td><td class=""></td></tr>
		</table>
		</form>
	</div>
	<div id="t2">
	</div>
	<div id="t3"></div>
	<div class="div_clear" style="height:30px;"></div>
	<script>
	var smallNowTab;
	var pt = new Tabs();
	var doaction="{$action}";
	pt.classpre="smalltab_";
	pt.container = "smalltab_container";
	pt.createTab("t1","版块合并","",true,"n");
	pt.init = function(){
		smallNowTab = pt.nowTab;
	};
	pt.onclick = function(){
		smallNowTab = pt.nowTab;
	};		
	pt.initTab();
	pt.clickNowTab();

	
	function ajax_mergeforum_yn(){
		if(E("fromfid").value==0||E("tofid").value==0){
			var btns=[
					{value:" 确 认 ",onclick:"popwin.close()",focus:true}
			];
			popwin.showDialog(2,"提示","请选择源版块与目标版块。",btns,320,130);
			return;
		}
		if(E("fromfid").value==E("tofid").value){
			var btns=[
					{value:" 确 认 ",onclick:"popwin.close()",focus:true}
			];
			popwin.showDialog(2,"提示","源版块与目标版块不能相同。",btns,320,130);
			return;
		}
		var btns=[
			{value:" 确 认 ",onclick:"mainifm.ajax_mergeforum()",focus:true},
			{value:" 取 消 ",onclick:"popwin.close()"}
		];
		popwin.showDialog(2,"确认","源版块的帖子全部转入目标版块，同时删除源版块。<br />是否确认继续？",btns,320,130);
	}
	
	function ajax_mergeforum(){
		popwin.loading();
		ajaxPost("forumdetailsform","forum_ajax.php?action=mergeforum",ajax_mergeforum_callback);
	}
	function ajax_mergeforum_callback(data){
		var btns=[{value:" 确 定 ",onclick:"popwin.close();mainifm.location.reload();",focus:true}];
		popwin.loaded();
		if(data=="y"){
			popwin.showDialog(1,"修改成功","版块合并成功",btns,280,130);
		}else{
			popwin.showDialog(0,"操作失败","操作失败:<br />"+data,btns,280,130);
		}
	}
	
	</script>
EOT;

	break;
	/************************************** merge BEGIN ************************************************/
}	
function getAdmins($admins){
	if(empty($admins)){
		return "设置版主";
	}else{
		$arr=array();
		foreach(explode("|",$admins) as $key=>$value){
			if(!empty($value)){
				array_push($arr,$value);
			}
		}
		$res=$arr[0];
		if(count($arr)>1){
			$res.='...';
		}
		if(empty($res)){
			$res="设置版主";
		}else{
			$res="<span title=\"".implode(",",$arr)."\">{$res}</span>";
		}
		return $res;
	}
}
?>